import { HashRouter, Route } from 'react-router-dom'; // react-router v4
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import configureStore from '../redux/configureStore';
import { createStore } from 'redux';
import '../styles/theme.less';
import Body from '../containers/Body';
import Admin from '../containers/Admin';
import App from '../views/App';
import Login from '../containers/Login';
import rootReducers from '../redux/rootReducers';

const store = configureStore(rootReducers); //window.__INITIAL_STATE__
ReactDOM.render(
    (<Provider store={store}>
        <HashRouter>
                <App>
                        <Route path="/home" exact component={Body} />
                        <Route path="/home/:id" exact component={Body} />
                        <Route path="/admin" exact component={Admin} />
                        <Route path="/login"  component={Login} />
                        <Route path="/admin/:id" component={Admin} />
                </App>
        </HashRouter></Provider>), document.getElementById('app'))

